home *** CD-ROM | disk | FTP | other *** search
- XdLibs Utility Function Library for MiNTlibs
- --------------------------------------------
-
- This library recreates many of the non-standard but useful routines from
- the dLibs/XdLibs standard library distributed with the HSC and SozobonX
- compilers. It is intended primarily for MiNTlibs users who may miss
- these functions.
-
- This archive should contain the following files:
-
- libextra.a
- The library itself. Place this in your $LIB or $LIBDIR path.
- extras.h
- Declarations for the routines in the library. Place this in your
- $INCLUDE or $INCLUDEDIR path.
- libextra.doc
- This file.
-
- The following functions are recreated from XdLibs. Consult the XdLibs
- documentation for descriptions.
- ==
- char *pfindfile(const char *path, const char *afn, const char *ext);
-
- char *wildcard(char *pathname);
- char *_splitpath(const char *src, char *drive, char *path, char *file,
- char *ext);
- char *_makepath(char *dst, const char *drive, const char *path,
- const char *file, const char *ext)
-
- char *strset(char *string, int c);
- char *strnset(char *string, int c, int n);
- char *substr(char *dest, char *source, int start, int end);
- char *subnstr(char *dest, char *source, int start, int length);
- char *stristr(char *string, char *pattern);
- char *strpcpy(char *dest, char *src, char *stop);
- int strpos(char *string, int symbol);
- char *strrpbrk(char *string, char *set);
- int strrpos(char *string, int symbol);
- char *strtrim(char *string, char *junk);
- char *stradj(char *string, int dir);
- int strrpl(char *string, char *ptrn, char *rpl, int n);
- int strirpl(char *string, char *ptrn, char *rpl, int n);
- int memicmp(char *blk1, char *blk2, int len);
- char *ctlcnv(char *string);
-
- char *lmemmove(char *dest, char *source, long len);
- char *lmemcpy(char *dest, char *source, long len);
-
- void *lalloc(long size);
- long lread(int h, char *data, long length);
- long lwrite(int h, char *data, long length);
-
- BASEPAGE *Getbpact_pd(void);
-
- unsigned int GetTOSvers __PROTO((long *OS_date, unsigned int *OS_conf,
- unsigned int * OS_dosdate));
-
- int Getcookie( long cookie, long *value );
-
- void perrorf(char *fmt, ...);
-
- int catch(jmp_buf context, int (*func)(void));
- void throw(jump_buf context, int rv);
-
- long fsize(char *name);
-
- long msize(char *addr);
-
- long memavail(void);
-
- clock_t start_timer(clock_t *t);
- clock_t time_since(clock_t *t);
-
- void swab(int *src, int *dst, int n);
-
- int bdos(int func, long parameter);
- ==
-
- The following functions from the XdLibs are not implemented:
- ==
- void *lsearch(char *key, char *base, int *num, int size, int (*cmp)())
- void *lfind(char *key, char *base, int *num, int size, int (*cmp)())
- int _tttty(FILE *fp)
- long teststack()
- int brk(void *address)
- int fork()
- void shell()
- int cfg_ch(int cfg)
- int getch()
- int getche()
- char putch(char c)
- int kbhit()
- char *getln(char *ip, int (*get)(), int (*put)(), char *buffer, int limit)
- void cputs(char *data)
- int cprintf(char *fmt, ...)
- void hsort(char *base, int num, int size, int (*cmp)())
- ==
- If you desperately need one of the above functions, or an XdLibs
- function not listed above, write me at the address below. [NB: If the
- function isn't listed here, then it's not in my XdLibs documentation, so
- you'll need to send a description as well.]
-
- These functions differ from the XdLibs functions in a few points, as
- follows:
- ==
- Functions that take filenames or pathnames are friendlier to extended
- filesystems, MinixFS in particular. This includes accepting both '/'
- and '\' as path separators, recognizing "/dev/a" as a drive specifier
- (and automaically translating it to "a:" in _splitpath()), and allowing
- for filenames with multiple .'s.
-
- perrorf() does not print the name of the program, since the MiNTlibs'
- startup code does not make it available.
-
- The value returned by memavail() takes TT RAM into account.
-
- ctlcnv() recognizes the additional escape sequence '\?', translating to
- '?' (for use with trigraphs).
- ==
-
-
- DISCLAIMER:
-
- What, you were expecting an ironclad guarantee of performance? ;) Okay,
- I've done enough sanity tests on the library to convince myself that it
- works as advertised, but I can't guarantee that there aren't still a few
- bugs lurking around in the code. Caveat emptor, use at your own risk,
- and all that jazz. And if you should happen to find a bug, please
- notify me at the address below.
-
- Scott Bigham dsb@cs.duke.edu
-